home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Complementary Applications 2004 February / SGI IRIX 6.5 Complementary Applications 2004 February.iso / dist / cde.idb / usr / dt / share / examples / dtksh / SelBoxResTest.z / SelBoxResTest
Encoding:
Text File  |  2003-11-18  |  2.7 KB  |  86 lines

  1. #! /usr/dt/bin/dtksh
  2. #
  3. # SelBoxResTest
  4. #
  5. # Copyright 2000, Silicon Graphics, Inc.
  6. # ALL RIGHTS RESERVED
  7. # UNPUBLISHED -- Rights reserved under the copyright laws of the United
  8. # States.   Use of a copyright notice is precautionary only and does not
  9. # imply publication or disclosure.
  10. #
  11. # U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  12. # Use, duplication or disclosure by the Government is subject to restrictions
  13. # as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  14. # in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  15. # in similar or successor clauses in the FAR, or the DOD or NASA FAR
  16. # Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  17. # 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  18. #
  19. # THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  20. # INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  21. # DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  22. # PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  23. # GRAPHICS, INC.
  24. #
  25. ##########################################################################
  26. #  (c) Copyright 1993, 1994 Hewlett-Packard Company    
  27. #  (c) Copyright 1993, 1994 International Business Machines Corp.
  28. #  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  29. #  (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
  30. #      Novell, Inc.
  31. ##########################################################################
  32.  
  33.  
  34. #
  35. # This sample shell script verifies that the selection box properly
  36. # interprets the 'childPlacement' resource.  Using a timer, it will
  37. # set the resource to a particular value, verify it is correct, and
  38. # then repeat for the next setting.
  39. #
  40.  
  41. Timeout3()
  42. {
  43.    XtGetValues $SB childPlacement:CP
  44.    echo ChildPlacement 
  45.    echo "   Expected = PLACE_TOP"
  46.    echo "   Actual   = " $CP
  47. }
  48.  
  49. Timeout2()
  50. {
  51.    XtGetValues $SB childPlacement:CP
  52.    echo ChildPlacement 
  53.    echo "   Expected = PLACE_BELOW_SELECTION"
  54.    echo "   Actual   = " $CP
  55.    XtSetValues $SB childPlacement:PLACE_TOP
  56.    XtAddTimeOut ID 5000 "Timeout3"
  57. }
  58.  
  59. Timeout1()
  60. {
  61.    XtGetValues $SB childPlacement:CP
  62.    echo ChildPlacement 
  63.    echo "   Expected = PLACE_ABOVE_SELECTION"
  64.    echo "   Actual   = " $CP
  65.    XtSetValues $SB childPlacement:PLACE_BELOW_SELECTION
  66.    XtAddTimeOut ID 5000 "Timeout2"
  67. }
  68.  
  69.  
  70. ######################### Create the Main UI #################################
  71.  
  72. XtInitialize TOPLEVEL selectionBoxTest SelectionBoxTest "$0" "$@"
  73.  
  74. XtCreateManagedWidget SB sb XmSelectionBox $TOPLEVEL \
  75.     childPlacement:PLACE_ABOVE_SELECTION
  76.  
  77. XtCreateManagedWidget SCALE scale XmScale $SB \
  78.     orientation:HORIZONTAL
  79.  
  80. XtRealizeWidget $TOPLEVEL
  81.  
  82. XtAddTimeOut ID 5000 "Timeout1"
  83.  
  84. XtMainLoop
  85.